/**
 * @file ci_assert.h
 * @brief assert
 * @version 1.0
 * @date 2019-02-21
 * 
 * @copyright Copyright (c) 2019 Chipintelli Technology Co., Ltd.
 * 
 */
#ifndef _CI_ASSERT_H_
#define _CI_ASSERT_H_

#include <stdio.h>


#define mprintf(fmt, args...) printf(fmt, ## args)

#define CI_ASSERT(x,msg)                                                                                                    \
    if( ( x ) == 0 )                                                                                                        \
    {                                                                                                                       \
        mprintf("%s",msg);                                                                                                   \
        mprintf("ASSERT ERROR : file \"%s\" Line \"%d\" Function \"%s\"\n",__FILE__,__LINE__,__FUNCTION__);                  \
        while(1)  asm volatile ("ebreak");                                                                                  \
    }

#endif /* _CI_ASSERT_H_ */
